package com.example.javaproject.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.javaproject.entity.Salary;
import com.example.javaproject.dto.SalaryDTO;
import com.example.javaproject.dto.SalaryStatsDTO;

import java.math.BigDecimal;
import java.util.List;

public interface SalaryService extends IService<Salary> {

    /**
     * 审核工资发放
     * @param id 工资记录ID
     * @param status 审核状态：1-通过，2-拒绝
     * @return 是否成功
     */
    boolean auditSalary(Integer id, Integer status);

    
    Page<SalaryDTO> getSalaryPage(Page<SalaryDTO> page, Integer status,
                                  String studentName, String teacherName, String positionName);

    /**
     * 获取学生工资分页信息
     * @param page 分页对象
     * @param studentId 学生ID
     * @return 工资分页信息
     */
    Page<SalaryDTO> getStudentSalaryPage(Page<SalaryDTO> page, Integer studentId);
    
    Page<SalaryDTO> getTeacherSalaryPage(Page<SalaryDTO> page, Integer teacherId,
                                         Integer status, String studentName, String positionName);

    
    boolean teacherApproveSalary(Integer salaryId, Integer teacherId);

    
    boolean teacherRejectSalary(Integer salaryId, Integer teacherId);

   
    boolean teacherResendSalary(Integer salaryId, Integer teacherId);

    /**
     * 教师修改工资信息
     * @param salaryId 工资记录ID
     * @param teacherId 教师ID
     * @param totalHour 总工时
     * @param totalSalary 总工资
     * @return 是否成功
     */
    boolean teacherUpdateSalary(Integer salaryId, Integer teacherId, Integer totalHour, BigDecimal totalSalary);

    List<SalaryStatsDTO> getSalaryStats();
}